<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String model_id=request.getParameter("model_id");
String current_date=request.getParameter("current_date");

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'add_image_stock.jsp' starting page</title>
	<META NAME="robots" CONTENT="All">
	<META NAME="noodp" CONTENT="ODP (Default)">
	<META NAME="googlebot" CONTENT="All">
	<META NAME="cache-control" CONTENT="public">
	<META NAME="pragma" CONTENT="public">
	<META NAME="google-site-verification" CONTENT="vtw1pu4-gkJ3-W7Tugu3TwiwoA4cFNz0Oy6lJfJ15a4"/>
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<META http-equiv="X-UA-Compatible" CONTENT="IE=EmulateIE7">
	<META http-equiv="Content-Type" CONTENT="text/html;charset=iso-8859-1">
	<script src="Scripts/mfcrm_js.js" type="text/javascript"></script>
    <script src="Scripts/box.js" type="text/javascript"></script>
    <link href="Styles/box.css" rel="stylesheet" type="text/css" />
    <link href="Styles/mfcrm_styles.css" rel="stylesheet" type="text/css" />
    <link media="screen" rel="stylesheet" href="Styles/colorbox.css" />
    <!--overlay video-->
    <script src="js/jquery.tools.min.js"></script>
    <!--popup overlay-->
   <script src="js/jquery.colorbox.js"></script>
	<script type="text/javascript">
	   {
	 function getstock_id()
             {  
             var idField = document.getElementById("img_year_start").value;
                var current_date = document.getElementById("current_date").value;
                //alert(idField);
                   var url = "STOCKIDAction?version_action="+idField+"&current_date="+current_date;
   
                    if (typeof XMLHttpRequest != "undefined") {
                        req = new XMLHttpRequest();
                    } else if (window.ActiveXObject) {
                        req = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    req.open("GET", url, true);
   
                    req.onreadystatechange = callback_stock_id_value;
                    req.send(null);
             }
           function callback_stock_id_value() {
   
                    if (req.readyState == 4) {
                        if (req.status == 200) {
                        var breakStr=req.responseText;
                        var temp=new Array();
                       
                        temp=  breakStr.split(':');
                        
                        var cida=temp[0];
                        //alert(cida);
                        var cdt=temp[0];
                        // alert(cdt);
                         document.getElementById("img_id").value=cida;
                         document.getElementById("stock_id").value=cdt;
                        }
                        }
                        }
                        }
		
	function openoverlaypopup()
	{ 
		$(".popupEnquiry").colorbox({width:"1000px", height:"540px", iframe:true});
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false; 
			});
		}
		
function popitup(url){
var img_id=document.getElementById("img_id").value;
var st=url;
	newwindow=window.open("http://192.168.0.2:90/image_master/document_image.jsp?img_id="+img_id,'','height=500,width=450');
	if (window.focus) {newwindow.focus();}
	return false;
}

function popitup1(url){
var img_id=document.getElementById("img_id").value;

var st=url;
	newwindow=window.open("http://192.168.0.2:90/image_master/MyHtml.jsp?img_id="+img_id,'','height=500,width=450');
	if (window.focus) {newwindow.focus();}
	return false;
}

function popitup2(url){
var img_id=document.getElementById("img_id").value;
var st=url;
	newwindow=window.open("http://192.168.0.2:90/image_master/InImage.jsp?img_id="+img_id,'','height=500,width=450');
	if (window.focus) {newwindow.focus();}
	return false;
}

function refreshParent() {
  window.opener.location.href = window.opener.location.href;
}
</script>
</head>
<body onload="getstock_id();">
<s:form name="insert_stock_image" action="update_image_stock">
<table border="0" cellpadding="0" cellspacing="0" align="center" width="80%" height="50%">
<tbody>
<tr>
<td width="80%" height="40" valign="middle" align="center" class="advance_tr">Add New Images Form:</td>
</tr>
<tr>
<td >
<br>
<table align="center" class="obox" cellpadding="0" width="80%" height="50%">
<tbody>
<tr>
<td>
<input name="current_date" id="current_date" value="<%=current_date%>" type="text" onclick="getstock_id();" readonly="readonly"/>
<input name="img_year_start" id="img_year_start" value="<%=model_id%>" type="text" readonly="readonly"/>
<input name="img_id" id="img_id" value="" type="text" readonly="readonly"/>
<input name="stock_id" id="stock_id" value="" type="text" readonly="readonly"/>
<div>
<table width="100%">
<tbody>
<tr>
<td style="width:100px;">
</td>
<td style="width:180px;"><a href="" id="hyperId" class="popupEnquiry"  onclick="return popitup('http://192.168.0.2:90/image_master/document_image.jsp')"  onmouseover="this.style.textDecoration='underline'" onMouseOut="this.style.textDecoration='none'" ><span class="footer_HeadlineBlueText">Document Image</span></a>
</td>
<td style="width:180px;"><a href="" id="exterior" class="popupEnquiry"  onclick="return popitup1('http://192.168.0.2:90/image_master/MyHtml.jsp')"  onmouseover="this.style.textDecoration='underline'" onMouseOut="this.style.textDecoration='none'" ><span class="footer_HeadlineBlueText">Exterior Image</span></a> 
</td>
<td style="width:180px;"><a href="" id="interior" class="popupEnquiry"  onclick="return popitup2('http://192.168.0.2:90/image_master/InImage.jsp')"  onmouseover="this.style.textDecoration='underline'" onMouseOut="this.style.textDecoration='none'" ><span class="footer_HeadlineBlueText">Interior Imgae</span></a>
</td>
<td style="width:180px;">View 360
</td>
<tr>
<td height="40px">
</td>
</tr>
 <tr valign="middle">
						        <td class="orgbg" colspan="10" align="center">
                                    <input type="submit" name="Button1" value="CONFIRM"  id="Button1" tabindex="66" class="btn" onclick="refreshParent();">
						          &nbsp;
                                    <input type="reset" name="Button2" value="RESET" id="Button2" tabindex="67" class="btn">
                                    </td>
					          </tr>

</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</s:form>
</body>
</html>
